<template>
	<view class="combody">
		<image v-show="type==1" @click="toWxkf" src="@/static/images/knowledge/drug/zxgg.png" style="margin-top: 16rpx;height: 120rpx;width: 100%;" mode=""></image>
		<image v-show="type==2" @click="toWxkf" src="@/static/images/knowledge/drug/mkdgg.png" style="margin-top: 16rpx;height: 120rpx;width: 100%;" mode=""></image>
		<image v-show="type==3" @click="toWxkf" src="@/static/images/knowledge/drug/xljgdgg.png" style="margin-top: 16rpx;height: 120rpx;width: 100%;" mode=""></image>
		<image v-show="type==4" @click="toWxkf" src="@/static/images/knowledge/drug/smsfy.png" style="margin-top: 16rpx;height: 160rpx;width: 100%;" mode=""></image>
	</view>
</template>

<script>
	export default {
		props:['type'],
		data() {
			return {
				
			}
		},
		methods: {
			toWxkf() {
				// window.open('https://work.weixin.qq.com/ca/cawcdedcf41d9a6af6')
					if (plus.os.name == 'Android') {
						//安卓
						if (
							plus.runtime.isApplicationExist({
								pname: 'com.tencent.mm'
							})
						) {
							plus.runtime.openURL(
								'https://work.weixin.qq.com/ca/cawcdef5355a9f50ae',
								function(res) {
									console.log(res);
								}
							);
						} else {
							uni.showModal({
								title: '提示',
								content: '您还没有此APP,去下载',
								success: function(res) {
									if (res.confirm) {
										plus.runtime.openURL('https://a.app.qq.com/o/simple.jsp?pkgname=com.tencent.mm', function(res) {
											console.log(res);
										});
									} else if (res.cancel) {
										console.log('用户点击取消');
									}
								}
							});
						}
					} else if (plus.os.name == 'iOS') {
						plus.runtime.launchApplication(
							{
								action:
									'https://work.weixin.qq.com/ca/cawcdef5355a9f50ae'
							},
							function(e) {
								uni.showModal({
									title: '提示',
									content: '您还没有此APP,去下载',
									success: function(res) {
										if (res.confirm) {
											plus.runtime.openURL('https://a.app.qq.com/o/simple.jsp?pkgname=com.tencent.mm', function(res) {
												console.log(res);
											});
										} else if (res.cancel) {
											console.log('用户点击取消');
										}
									}
								});
							}
						);
					}
			},
		}
	}
</script>

<style lang="scss" scoped>
	.combody{
		
	}
</style>